package com.snakegame.ui;

import com.snakegame.core.GameManager;

import javax.swing.*;
import java.awt.*;

/**
 * 计分板，显示游戏分数和其他信息
 */
public class ScoreBoard extends JPanel {
    private GameManager gameManager;
    private JLabel scoreLabel;
    
    public ScoreBoard(GameManager gameManager) {
        this.gameManager = gameManager;
        
        setLayout(new FlowLayout(FlowLayout.LEFT));
        setBackground(Color.BLACK);
        
        scoreLabel = new JLabel("分数: 0");
        scoreLabel.setForeground(Color.WHITE);
        scoreLabel.setFont(new Font("宋体", Font.BOLD, 16));
        add(scoreLabel);
    }
    
    public void updateScore(int score) {
        scoreLabel.setText("分数: " + score);
    }
}    